﻿using System;
public class Circle
{
    private double _radius;

    public Circle(double radius)
    {
        _radius = radius;
    }

    public double GetRadius()
    {
        return _radius;
    }

    public void SetRadius(double radius)
    {
        if (radius >= 0)
        {
            _radius = radius;
        }
    }
    public double CalculatePerimeter()
    {
        return 2 * Math.PI * _radius;
    }
    public double CalculateArea()
    {
        return Math.PI * _radius * _radius;
    }
}
class Program
{
    static void Main(string[] args)
    {
        Circle circle = new Circle(5);
        Console.WriteLine($"圆的半径：{circle.GetRadius()}");
        Console.WriteLine($"圆的周长：{circle.CalculatePerimeter():F2}");
        Console.WriteLine($"圆的面积：{circle.CalculateArea():F2}");
        circle.SetRadius(10);
        Console.WriteLine("\n修改半径为10后：");
        Console.WriteLine($"圆的周长：{circle.CalculatePerimeter():F2}");
        Console.WriteLine($"圆的面积：{circle.CalculateArea():F2}");
    }
}
